package com.loyal.loyalerp.basedata.permission.mapper;

import java.util.List;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;

import com.loyal.loyalerp.basedata.permission.mapper.provider.GyPermissionProvider;
import com.loyal.loyalerp.basedata.permission.model.GyPermission;
@Mapper
public interface GyPermissionMapper {
	

	@Select("select * from gy_permission")
	List<GyPermission> listPermission();
	
	@SelectProvider(type=GyPermissionProvider.class,method="listByActionCode")
	List<GyPermission> listByActionCode(String actioncode);
	
	@SelectProvider(type=GyPermissionProvider.class,method="listPermission")
	List<GyPermission> listSortedPermission(String sidx,String sord);
	
	@SelectProvider(type=GyPermissionProvider.class,method="findPermission")
	List<GyPermission> findPermission(String searchField, String searchString);
	
	@DeleteProvider(type=GyPermissionProvider.class,method="deletePermissionByActionCode")
	int deleteByForeignKey(String actionCode);
	
	@DeleteProvider(type=GyPermissionProvider.class,method="deletePermissionBySystemCode")
	int deleteBySystemCode(String systemCode);
	
	//根据permissionCode查到entityCode和actionCode
	@SelectProvider(type=GyPermissionProvider.class,method="selectECAndACByPermissionCode")
	GyPermission selectECAndACByPermissionCode(String permissionCode);
	
    int deleteByPrimaryKey(Integer id);

    int insert(GyPermission record);

    int insertSelective(GyPermission record);

    GyPermission selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(GyPermission record);

    int updateByPrimaryKey(GyPermission record);
 // <!-- rolePermission部分：查询所有权限，返回权限名 -->
    public List<GyPermission> queryAllPermisssion() throws Exception;
}